#include<stdio.h>
int main() {
	char str[3][81];
	int upper=0,lower=0,digit=0,space=0,other=0;
	for (int i=0;i<3;i++)
	{
		gets(str[i]);
	}
	for (int i=0;i<3;i++)
		for(int j=0;str[i][j]!='\0';j++)
			{
				if (str[i][j]>='A' && str[i][j]<='Z')
					upper++;
				else if (str[i][j]>='a' && str[i][j]<='z')
					lower++;
				else if (str[i][j]>='0' && str[i][j]<='9')
					digit++;
				else if (str[i][j]==' ')
					space++;
				else
					other++;
			}
 printf("%d %d %d %d %d",upper,lower,digit,space,other);
	return 0;
}
